package com.rc.saas.tenant.service.elec;


import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseSearch;
import com.rc.saas.tenant.base.BaseService;
import com.rc.saas.tenant.common.vo.TResponse;
import com.rc.saas.tenant.mapper.elec.ElecPileMapper;
import com.rc.saas.tenant.model.elec.ElecPile;
import com.rc.saas.tenant.model.elec.ElecPileExample;
import com.rc.saas.tenant.model.elec.ElecStation;
import com.rc.saas.tenant.search.StatisticsSearch;
import com.rc.saas.tenant.search.elec.ElecPileFailureSearch;
import com.rc.saas.tenant.search.elec.ElecPileSearch;
import com.rc.saas.tenant.search.elec.PileOfflineSearch;
import com.rc.saas.tenant.vo.elec.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface ElecPileService extends BaseService<Long, ElecPile, ElecPileExample, ElecPileMapper> {

    long countLoginPile(String tenantCode);

    long countPile(String tenantCode, String pileType);

    void deletePileAndGun(Long elecPileId);

    void changeStatus(Long elecPileId);

    BigDecimal sumTotalPowerByEpg(String tenantCode);

    /**
     * 通过桩群id寻找对应的桩
     */
    List<ElecPile> listPileByStationId(Long stationId);

    ElecPile selectLastPileNo(String tenantCode, String pileNo);

    TResponse saveOrUpdateElecPile(ElecPile elecPile, String tenantCode, String loginName);

    ElecPileStatusCountVo selectCountByPileStatus(String tenantCode, Long eleStationId);

    ElecPileStatusCountVo selectCountByPileStatusOperator(String tenantOperatorCode, Long eleStationId);

    PageInfo<ElecPileResultVo> listPagePile(ElecPileSearch elecPileSearchVo);

    PageInfo<ElecPile> searchPileFailure(ElecPileFailureSearch elecPileFailureSearch);

    /**
     * 正向互联时，根据第三方运营商ID和第三方桩桩编号查找（唯一）
     */
    ElecPile selectByOperatorIdAndPileNo(String tenantCode, String hlhtOperatorId, String hlhtPileNo);

    /**
     * 根据elec_station_id批量更新桩运营状态,正向互联时status才有值
     */
    void updateBatchElecPileOperateStatusByElecStationIdList(List<Long> elecStationIdList, String operateStatus, Integer status);


    PageInfo<ElecPile> listPageElecPile(ElecPileSearch elecPileSearch);

    List<ElecPile> listElecPileByStationIdList(List<Long> elecStationIdList);

    /**
     * 根据elecPileId,获取ElecPile
     *
     * @param elecPileIdList
     * @return
     */
    List<ElecPile> listElecPileByElecPileIdList(List<Long> elecPileIdList);

    PageInfo<PileOfflineVo> listPagePileOffline(PileOfflineSearch pileOfflineSearch);

    PileOfflineVo selectPileOfflineInfo(Long elecPileId, Date beginTime,Date endTime);

    PileOffineStatisticsVo selectPileOffineStatistics(String tenantCode);

    List<PileOfflineVo> listPileOffline(PileOfflineSearch pileOfflineSearch);

    List<ElecPile> selectListPiles(String tenantCode);

    ElecPileStatusCountVo selectCountByPileStatus(String tenantCode, Long eleStationId, String bizType);

    StationAllDataVo countPileInConsole(StatisticsSearch search);

    List<ElecPile> listByElecStationId(Long elecStationId);

    void updateOperatorBySId(ElecStation elecStation);
}
